package com.hzh.jetpackcomposecompositionlocal.sample

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import com.hzh.jetpackcomposecompositionlocal.ui.theme.DN_Compose_LearnTheme

/**
 * @author huangzehui
 * @date 18/8/2025 上午12:09 周一
 * @description
 */

@Composable
fun CompositionSample1() {
    DN_Compose_LearnTheme {
        CustomTextLabel(labelText = "Some composable deep in the hierarchy of MaterialTheme")
    }
}

@Composable
fun CustomTextLabel(labelText: String) {
    Text(
        text = labelText,
        // 这里是隐藏传参，MaterialTheme.colorScheme 就是调用 LocalColorScheme.current
        color = MaterialTheme.colorScheme.primary
    )
}